include ../includes/shared-mixins.pug

if (nextHalvingData.nextHalvingIndex > -1)
	+summaryRow(5)
		+summaryItem("Blocks Remaining")
			| #{nextHalvingData.blocksUntilNextHalving.toLocaleString()}

		+summaryItem("Time Remaining", "The estimated time until halving, based on the number of blocks remaining and the current mining rate (up until the next difficulty adjustment).")
			+timeAgo(nextHalvingData.nextHalvingDate.getTime() / 1000, {showPlus:false})

		+summaryItem("Date / Time", "The date of halving, estimated based on the number of blocks remaining and the current mining rate (up until the next difficulty adjustment).")
			+timestamp(nextHalvingData.nextHalvingDate.getTime() / 1000, {includeAgo:false, separateUtcDateIfNeeded:true})

		+summaryItem("Block Height", "The block height at which the new block subsidy will begin.")
			| #{nextHalvingData.nextHalvingBlock.toLocaleString()}

		+summaryItem("New Subsidy", "The new supply that will be created (and rewarded to the winning miner) for each new block during the next halving's era.")
			- let subsidy = coinConfig.blockRewardFunction(nextHalvingData.nextHalvingBlock, global.activeBlockchain);
			+valueDisplay(subsidy)
		
	- let progressPercent = new Decimal(nextHalvingData.halvingBlockInterval).minus(nextHalvingData.blocksUntilNextHalving).dividedBy(nextHalvingData.halvingBlockInterval).times(100);
	.progress.mt-3(role="progressbar", aria-label="Next halving progress", aria-valuenow=progressPercent.toDP(0), aria-valuemin="0", aria-valuemax="100")
		.progress-bar(style=`width: ${progressPercent.toDP(0)}%`)
			| #{progressPercent.toDP(4)}%


